import { FormSchema } from '@/components/Table';
import { DescItem } from '@/components/Description';
import { connectionStateOptions } from '@/enums/connection'

export const searchFormSchema: FormSchema[] = [
  {
    field: 'name',
    label: '名称',
    component: 'Input',
    colProps: { span: 8 },
  },
  {
    field: 'state',
    label: '状态',
    component: 'Select',
    componentProps: {
      options: connectionStateOptions,
    },
    colProps: { span: 8 },
  },
];

export const organizationDetailSchema: DescItem[] = [
  {
    field: 'name',
    label: '名称',
  },
  {
    field: 'contact_info',
    label: '联系方式',
  },
  {
    label: '备注',
    field: 'remarks',
  },
];

export const formSchema: FormSchema[] = [
  {
    field: 'organization',
    label: '企业',
    component: 'AutoComplete',
    required: true,
    slot: 'organization',
  },
  {
    field: 'time',
    component: 'RangePicker',
    label: '有效日期',
    required: true,
  },
];